<template>
  <!-- 热搜 -->
  <div class="hot-search-box">
    <!-- titile -->
    <div class="h-s-title">
      <div>热搜</div>
      <div style="color: #ccc" @click="triggerBtn">展开</div>
    </div>
    <div :class="className">
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        11111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111111111111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        1111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        1111111111111111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        1111111111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
      <div class="gray-box">
        <span class="g-img">热</span>
        111
      </div>
    </div>
  </div>
</template>

<script>
import {ref} from 'vue'
export default {
  name: 'FissionFriendsH5Triggerbox',
  props: {
    title: {
      type: String
    }
  },
  setup() {
    const activeNames = ref(['1'])
    const classFlag = ref(true)
    const className = ref('h-s-chunk-small')
    const triggerBtn = () => {
      classFlag.value = !classFlag.value
      classFlag.value ? (className.value = 'h-s-chunk-small') : (className.value = 'h-s-chunk-medium')
      console.log(classFlag.value)
    }
    return { activeNames, classFlag, className, triggerBtn }
  }
}
</script>

<style lang="scss" scoped>
.hot-search-box {
  margin-top: 10px;
  //   标题和展开部分
  .h-s-title {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
  }
  // 内容部分
  .h-s-chunk-medium,
  .h-s-chunk-small {
    display: flex;
    flex-wrap: wrap;
  }

  .h-s-chunk-small {
    max-height: 100px;
    overflow: hidden;
  }
  .h-s-chunk-medium {
    max-height: 200px;
    overflow-y: auto;
  }
  .gray-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    min-width: 30px;
    border-radius: 5px;
    background-color: gray;
    margin: 10px 10px 10px 0;
    .g-img {
      padding: 3px;
      margin-right: 3px;
      border-radius: 3px;
      background-color: pink;
    }
  }
}
</style>
